package tuhao.hibernate.www.serviceImpl;


import tuhao.hibernate.www.common.model.jpa.PageDataList;
import tuhao.hibernate.www.common.model.jpa.QueryParam;
import tuhao.hibernate.www.service.BaseService;

import java.io.Serializable;
import java.util.Collection;
import java.util.List;
import java.util.Map;

public abstract class BaseServiceImpl<T> implements BaseService<T> {

	@Override
	public int countByCriteria(QueryParam param) {
		return getBaseDao().countByCriteria(param);
	}

	@Override
	public T save(T entity) {
		return getBaseDao().save(entity);
	}

	@Override
	public void save(Collection<T> ts) {
		getBaseDao().save(ts);
	}

	@Override
	public T update(T entity) {
		return getBaseDao().update(entity);
	}

	@Override
	public boolean update(Collection<T> ts) {
		return getBaseDao().update(ts);
	}

	@Override
	public void updateWithRefresh(T entity) {
		getBaseDao().updateWithRefresh(entity);
	}

	@Override
	public void refresh(T entity) {
		getBaseDao().refresh(entity);
	}

	@Override
	public T find(Serializable entityId) {
		return getBaseDao().find(entityId);
	}

	@Override
	public T find(Class<T> entityClass, Object id) {
		return getBaseDao().find(entityClass, id);
	}

	@Override
	public T findWithLock(Serializable entityId) {
		return getBaseDao().findWithLock(entityId);
	}

	@Override
	public void delete(Serializable entityid) {
		getBaseDao().delete(entityid);
	}

	@Override
	public void delete(Serializable[] entityids) {
		getBaseDao().delete(entityids);
	}

	@Override
	public void delete(Collection<T> c) {
		getBaseDao().delete(c);
	}

	@Override
	public T merge(T entity) {
		return getBaseDao().merge(entity);
	}

	@Override
	public void lock(T entity) {
		getBaseDao().lock(entity);
	}

	@Override
	public void clear() {
		getBaseDao().clear();
	}

	@Override
	public void detach(Collection<T> ts) {
		getBaseDao().detach(ts);
	}

	@Override
	public void detach(Serializable entityid) {
		getBaseDao().detach(entityid);
	}

	@Override
	public void flush() {
		getBaseDao().flush();
	}

	@Override
	public List<T> findAll() {
		return getBaseDao().findAll();
	}

	@Override
	public List<T> findByCriteria(QueryParam param) {
		return getBaseDao().findByCriteria(param);
	}

	@Override
	public T findByCriteriaForUnique(QueryParam param) {
		return getBaseDao().findByCriteriaForUnique(param);
	}

	@Override
	public List<T> findByCriteria(QueryParam param, int start, int limit) {
		return getBaseDao().findByCriteria(param, start, limit);
	}

	@Override
	public List<T> findByProperty(String property, Object value) {
		return getBaseDao().findByProperty(property, value);
	}

	@Override
	public T findObjByProperty(String property, Object value) {
		return getBaseDao().findObjByProperty(property, value);
	}

	@Override
	public PageDataList<T> findPageList(QueryParam param) {
		return getBaseDao().findPageList(param);
	}

	@Override
	public PageDataList<T> findPageListBySql(String sql, QueryParam param) {
		return getBaseDao().findPageListBySql(sql, param);
	}

	@Override
	public <G> PageDataList<G> findPageListBySql(String sql, QueryParam param,
												 Class<G> clazz) {
		return getBaseDao().findPageListBySql(sql, param, clazz);
	}

	@Override
	public <G> List<G> findBySql(String sql, QueryParam param, Class<G> clazz) {
		return getBaseDao().findBySql(sql, param, clazz);
	}

	@Override
	public PageDataList<T> findAllPageList(QueryParam param) {
		return getBaseDao().findAllPageList(param);
	}

	@Override
	public int updateByJpql(String jpql, String[] names, Object[] values) {
		return getBaseDao().updateByJpql(jpql, names, values);
	}

	@Override
	public List<T> listByJpql(String sql, String[] names, Object[] values) {
		return getBaseDao().listByJpql(sql, names, values);
	}

	@Override
	public int updateBySql(String nativeSql, String[] names, Object[] values) {
		return getBaseDao().updateByJpql(nativeSql, names, values);
	}

	@Override
	public List<Map<String, Object>> listMapBySql(String sql, String[] names,
												  Object[] values) {
		return getBaseDao().listMapBySql(sql, names, values);
	}

	@Override
	public <G> List<G> listBySql(String sql, String[] names, Object[] values,
								 Class<G> clazz) {
		return getBaseDao().listBySql(sql, names, values, clazz);
	}

	@Override
	public <G> G findForUniqueBySql(String sql, String[] names,
									Object[] values, Class<G> clazz) {
		return getBaseDao().findForUniqueBySql(sql, names, values, clazz);
	}

	@Override
	public List<T> listBySql(String sql, String[] names, Object[] values) {
		return getBaseDao().listBySql(sql, names, values);
	}

	@Override
	public T findForUniqueBySql(String sql, String[] names, Object[] values) {
		return getBaseDao().findForUniqueBySql(sql, names, values);
	}

	@Override
	public <G> PageDataList<G> findPageListBySql(String selectSql,
												 String formSql, QueryParam param, Class<G> clazz) {
		return getBaseDao().findPageListBySql(selectSql, formSql, param, clazz);
	}
}
